import { Navigate } from "react-router-dom";
import {getItem} from '@/utils/localStorage'
import { TOKEN_KEY } from "@/constants";


const AuthRoute = ({children})=>{
    if(!getItem(TOKEN_KEY)){
         return <Navigate to="/login" replace />
    }else{
         return <>{children}</>;
    }
}

export default AuthRoute;